﻿using System.IO.Ports;
using System.Text;
using ToolLibrary;

namespace SerialTools
{
    /// <summary>
    /// 
    /// </summary>
    public class Config
    {
        /// <summary>
        /// 
        /// </summary>
        public string PortName = "COM1";

        /// <summary>
        /// 奇偶校验位
        /// </summary>
        public Parity Parity = Parity.None;

        /// <summary>
        /// 数据位
        /// </summary>
        public int DataBits = 8;

        /// <summary>
        /// 停止位
        /// </summary>
        public StopBits StopBits = StopBits.One;

        /// <summary>
        /// 
        /// </summary>
        public Handshake Handshake = Handshake.None;

        /// <summary>
        /// 
        /// </summary>
        public bool RightHide = false;

        /// <summary>
        /// 
        /// </summary>
        public bool BottomVisible = true;


        /// <summary>
        /// 
        /// </summary>
        public int BaudRate = 9600;

        ///// <summary>
        ///// 接收数据延时时间，单位 毫秒
        ///// </summary>
        //public int RevSleepMissSecond = 10;

        /// <summary>
        /// 
        /// </summary>
        public bool AutoOpenOnStart = true;


        /// <summary>
        /// 
        /// </summary>
        public string SendData1 = "";

        /// <summary>
        /// 
        /// </summary>
        public string SendData2 = "";

        /// <summary>
        /// 
        /// </summary>
        public string SendData3 = "";

        /// <summary>
        /// 
        /// </summary>
        public bool SendHex = true;

        /// <summary>
        /// 接收数据时显示16进制
        /// </summary>
        public bool ReceiveHex = true;

        /// <summary>
        /// 是否统计通讯耗时，单位毫秒
        /// </summary>
        public bool StatCommTime = true;

        /// <summary>
        /// 当显示ASCII码时，同步显示16进制
        /// </summary>
        public bool ShowHexOnAscii = true;

        /// <summary>
        /// 收到数据后延时多少毫秒，方便数据集中
        /// </summary>
        public int DelayMsOnReceiveData = 10;

        /// <summary>
        /// 
        /// </summary>
        public List<BatchSendCmd> BatchCmd = new List<BatchSendCmd>();

        /// <summary>
        /// 
        /// </summary>
        public List<AutoBackRule> AutoBackRule = new List<AutoBackRule>();

        /// <summary>
        /// 
        /// </summary>
        public int SplitterDistance = 700;

        /// <summary>
        /// 记录串口号
        /// </summary>
        public bool LogPort = true;

        /// <summary>
        /// 
        /// </summary>
        public SizeType BatchCmdBtnSizeType = SizeType.AutoSize;

        /// <summary>
        /// 
        /// </summary>
        public float BatchCmdBtnWidth = 50;

        /// <summary>
        /// 
        /// </summary>
        public int WindowWidth = 1200;

        /// <summary>
        /// 
        /// </summary>
        public int WindowHeight = 700;

        /// <summary>
        /// 
        /// </summary>
        public bool WindowTopMost = false;

        /// <summary>
        /// 
        /// </summary>
        public int LocationX = 600;

        /// <summary>
        /// 
        /// </summary>
        public int LocationY = 400;

        /// <summary>
        /// 最后选择的命令文件
        /// </summary>
        public string LastOpenCmdNote = "cmdNote1.txt";

        /// <summary>
        /// 最后选的页索引
        /// </summary>
        public int LastSelectedPageIndex = 0;
    }

}
